﻿<sap:ActivityDesigner x:Class="Vision.Core.ActivityComponents.Collections.AddToDictionaryDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:converters="clr-namespace:Vision.Core.ActivityComponents.Converters"
    Collapsible="True" ExpandState="True">
    <sap:ActivityDesigner.Resources>
        <sapc:ArgumentToExpressionConverter x:Key="ArgumentToExpressionConverter" />
        
        <DataTemplate x:Uid="DataTemplate_6" x:Key="ExpandedActivityViewTemplate">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                
                <TextBlock Grid.Column="0" Text="Key:" />
                <TextBlock Grid.Column="1" Text="Value:" Margin="7,0,0,0" />

                <sapv:ExpressionTextBox Grid.Row="1" Grid.Column="0" Expression="{Binding Path=ModelItem.Key, Mode=TwoWay, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In}" ExpressionType="{Binding Path=ModelItem.Key.ArgumentType}" OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
                <sapv:ExpressionTextBox Grid.Row="1" Grid.Column="1" Margin="7,0,0,0" Expression="{Binding Path=ModelItem.Item, Mode=TwoWay, Converter={StaticResource ArgumentToExpressionConverter}, ConverterParameter=In}" ExpressionType="{Binding Path=ModelItem.Item.ArgumentType}" OwnerActivity="{Binding Path=ModelItem, Mode=OneWay}" />
            </Grid>
        </DataTemplate>

        <DataTemplate x:Uid="DataTemplate_6" x:Key="CollapsedActivityViewTemplate">
            <Label x:Uid="TextBlock_6" Padding="0,0,0,0" FontStyle="Italic" Foreground="{x:Static SystemColors.GrayTextBrush}" HorizontalAlignment="Center" VerticalAlignment="Center" Content="Double-click to view"/>
        </DataTemplate>

        <Style x:Uid="Style_1" x:Key="CollapsibleStyle" TargetType="{x:Type ContentPresenter}">
            <!--<Setter x:Uid="Setter_1" Property="ContentTemplate" Value="{DynamicResource CollapsedActivityViewTemplate}" />-->
            <Setter x:Uid="Setter_1" Property="ContentTemplate" Value="{DynamicResource ExpandedActivityViewTemplate}" />
            <Style.Triggers>
                <DataTrigger x:Uid="DataTrigger_1" Binding="{Binding ShowExpanded}" Value="false">
                    <Setter x:Uid="Setter_2" Property="ContentTemplate" Value="{DynamicResource CollapsedActivityViewTemplate}" />
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </sap:ActivityDesigner.Resources>

    <ContentPresenter x:Uid="ContentPresenter" Style="{DynamicResource CollapsibleStyle}" Content="{Binding}" />
</sap:ActivityDesigner>
